<?php use_helper('Form') ?>


  <script src="http://code.jquery.com/jquery-latest.js"></script>
  
  <script>
  
  jQuery(document).ready(function(){
    
    jQuery("#user_type_2").click(function(){
      $(".reg_form").animate({"left": "-=300"}, "slow");
      $(".operator_form").slideDown("slow");
    });

    jQuery("#user_type_1").click(function(){
      $(".reg_form").animate({"left": "+=300"}, "slow");
      $(".operator_form").slideUp("slow");
    });
    
    $('#sf_guard_user_username').keyup(function(key){
	  if (this.value.length >= 3 || this.value == '')
	  {
	    $('#id_verify').load(
	      "/register/verify", { param: this.value }
	    );
	  }
	});
	
	$('#sf_guard_user_email').keyup(function(key){
	//  if (this.value.length >= 3 || this.value == '')
	//  {
	    $('#id_verify_email').load(
	      "/register/verifyEmail", { param: this.value }
	    );
	 // }
	});

  });
  </script>
  <style>
  #reg_form { 
    position:relative; 
    width:600px;
    border:none;
    margin-left:auto;margin-right:auto;
  	top:0px;
    
  }
  #operator_form {position:relative;top:-300px;left:370px;display:none;width:500px;border:none}
  </style>
<br>
<div id="mainBody">

<form action="<?php echo url_for('register/create') ?>" method="POST">

<table>
<tr><td  class="reg_label"> Account Type<td>Operator<?php echo radiobutton_tag('user_type', '2', false) ?>
    Traveler<?php echo radiobutton_tag('user_type', '1', true) ?></td></tr>
</table>

<div id="reg_form" class="reg_form">
  <table align="center" class="reg" name="reg" id="id_reg">
    
    
    <?php echo "<tr><td class='reg_label'>Username:<td class='reg'>" . $form['username']->render(array("class"=>"reg")) ?>
    <td class="reg_verify"><div style="border:none;width:50px;height:20px;margin-left:0px;" id="id_verify" name="verify"></div>
    <tr><td  class="reg_label">Password:<td class="reg"><?php echo $form['password']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">First Name:<td class="reg"><?php echo $form['first_name']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">Last Name:<td class="reg"><?php echo $form['last_name']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">Email:<td class="reg"><?php echo $form['email']->render(array("class"=>"reg")) ?></td>
    <td class="reg_verify"><div style="border:none;width:50px;height:20px;margin-left:0px;" id="id_verify_email" name="verify_email"></div>
    <tr><td  class="reg_label">Address:<td class="reg"><?php echo $form['address']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">Address 2:<td class="reg"><?php echo $form['address2']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">City:<td class="reg"><?php echo $form['city']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">Country:<td class="reg"><?php echo $form['country']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">State:<td class="reg"><?php echo $form['state']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">Zip:<td class="reg"><?php echo $form['zip']->render(array("class"=>"reg")) ?></td>
    <tr><td  class="reg_label">Phone:<td class="reg"><?php echo $form['phone']->render(array("class"=>"reg")) ?></td>
    <tr></tr>
      <td colspan="2">
        <input type="submit" />
      </td>
    </tr>
  </table>
  </div>
  <div id="operator_form" class="operator_form"> 
    <table>
  <tr><td  class="reg_label">Company:<td class="reg"><?php echo $form['company']->render(array("class"=>"reg")) ?></td>
  <tr><td  class="reg_label">Company Description:<td class="reg"><?php echo $form['company_description']->render(array("class"=>"reg")) ?></td>
  </table>
  </div>
</form>



</div>
